﻿@{
    ViewBag.Title = "Index";
   
}
@model HotelMgr.Models.Order
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm("Create", "OrderPanelBar", FormMethod.Post, new { id = "orderForm" }))
{
    
    <table width="100%">
        <tr>
            <th>
                @Html.ValidationSummary(true)
                @Html.HiddenFor(model => model.Customer.CustomerID)
                <div class="editor-label">
                    @Html.LabelFor(model => model.Customer.Name):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Customer.Name)
                    @Html.ValidationMessageFor(model => model.Customer.Name)
                </div>
            </th>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.Customer.Sex):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Customer.Sex)
                    @Html.ValidationMessageFor(model => model.Customer.Sex)
                </div>
            </th>
        </tr>
        <tr>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.Customer.IDCard):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Customer.IDCard)
                    @Html.ValidationMessageFor(model => model.Customer.IDCard)
                </div>
            </th>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.Customer.Phone):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Customer.Phone)
                    @Html.ValidationMessageFor(model => model.Customer.Phone)
                </div>
            </th>
        </tr>
        <tr>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.PeopleNumber):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.PeopleNumber)
                    @Html.ValidationMessageFor(model => model.PeopleNumber)
                </div>
            </th>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.OrderTime):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.OrderTime)
                    @Html.ValidationMessageFor(model => model.OrderTime)
                </div>
            </th>
        </tr>
        <tr>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.CheckInTime):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.CheckInTime)
                    @Html.ValidationMessageFor(model => model.CheckInTime)
                </div>
            </th>
            <th>
                <div class="editor-label">
                    @Html.LabelFor(model => model.CheckOutTime):
                </div>
            </th>
            <th>
                <div class="editor-field">
                    @Html.EditorFor(model => model.CheckOutTime)
                    @Html.ValidationMessageFor(model => model.CheckOutTime)
                </div>
            </th>
        </tr>
        <tr>
            <th>
                <div class="editor-label">
                    房间列表
                </div>
            </th>
            <th colspan="3">
                <input type="text" name="txtRoomList" id="txtRoomList" value="" style="width: 200px;"
                    readonly="readonly" />
                <input type="button" id="btnChooseRoom" value="选择房间" />
            </th>
        </tr>
    </table>

    
    <div id="orderSubmit" style="text-align: center;">
        <input type="submit" value="生成订单" />
    </div>
    <div style="text-align: right;font-size: 18px;font-weight: bolder;">
    @Html.ActionLink("返回", "Index")
    </div>
}
@{
    Html.Telerik().Window()
        .Name("windowRoomList").Title("选择房间")
        .Width(800).Height(400)
        .Buttons(buttons => buttons.Refresh().Maximize().Close())
        .Draggable(true).Scrollable(true)
        .LoadContentFrom("RoomInfo", "OrderPanelBar")
        .Visible(false).Resizable()
        .Render();
}
<script type="text/javascript">

    $("#btnChooseRoom").click(function () {
        var window = $("#windowRoomList").data("tWindow");
        window.center();
        window.open();
    });

    function windowRoomListClose() {
        var window = $("#windowRoomList").data("tWindow");
        window.close();
    }
</script>
